package com.qf.test4;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.ObjectOutputStream;

public class MainTest {

	
	
	public static void main(String[] args) {
		
		Book b= new Book("s101","《史记》","司马光",23.5);
		
		File file = new File("./src/com/qf/test4/file.txt");
		
		FileOutputStream out;
		try {
			out = new FileOutputStream(file);
			ObjectOutputStream oos = new ObjectOutputStream(out);
			
			oos.writeObject(b);
			
			
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}catch(Exception e) {
			e.printStackTrace();
			
		}
		
		
		
	}
}
